widget: emit synthesized crossing event with correct device position
authorLionel Landwerlin <llandwerlin@gmail.com>
Thu, 18 Jul 2013 10:49:43 +0000 (11:49 +0100)
committerLionel Landwerlin <llandwerlin@gmail.com>
Mon, 27 Jan 2014 13:25:55 +0000 (13:25 +0000)
https://bugzilla.gnome.org/show_bug.cgi?id=704456

gtk/gtkwidget.c

index f4246ac7ccf876374ed9aaf78e5efed7c8640a62..0b2aac3dd7fdeef51dd88bc1695847ffb8f35b99 100644 (file)
@@ -11893,8 +11893,15 @@ synth_crossing (GtkWidget       *widget,
   event->crossing.send_event = TRUE;
   event->crossing.subwindow = g_object_ref (window);
   event->crossing.time = GDK_CURRENT_TIME;
-  event->crossing.x = event->crossing.y = 0;
-  event->crossing.x_root = event->crossing.y_root = 0;
+  gdk_device_get_position_double (device,
+                                  NULL,
+                                  &event->crossing.x_root,
+                                  &event->crossing.y_root);
+  gdk_window_get_device_position_double (window,
+                                         device,
+                                         &event->crossing.x,
+                                         &event->crossing.y,
+                                         NULL);
   event->crossing.mode = mode;
   event->crossing.detail = detail;
   event->crossing.focus = FALSE;